{include file="public/_meta" /}
<body>
<style>
    .required_b{
        color: red;
    }
</style>
<div class="wrapper">

    {include file="public/_header" /}

    <!-- Sidebar -->
    {include file="public/_menu" /}
    <!-- End Sidebar -->

    <div class="main-panel">

        <div class="content">
            <div class="page-inner">

                <!-- 面包屑 -->
                {include file="public/_page_header" /}

                <div class="row">
                    <div class="col-md-12">
                        <div class="card">
                            <div class="card-header">
                                <div class="d-flex align-items-center">
                                    <h4 class="card-title">余额明细</h4>
                                </div>
                            </div>

<!--                            <form class="row">-->

<!--                                <div class="col-md-6 col-lg-2">-->
<!--                                    <div class="form-group">-->
<!--                                        <select class="form-control input-full" name="type" id="type">-->
<!--                                            <option value="">全部类型</option>-->
<!--                                            <option value="1">充值</option>-->
<!--                                            <option value="2">赠送</option>-->
<!--                                        </select>-->
<!--                                    </div>-->
<!--                                </div>-->

<!--                                <div class="col-md-6 col-lg-2">-->
<!--                                    <div class="form-group">-->
<!--                                        <input type="text" class="form-control"  name="times" id="times" value="{$times}" placeholder="创建时间" autocomplete="off">-->
<!--                                    </div>-->
<!--                                </div>-->

<!--                                <div class="col-md-6 col-lg-2">-->
<!--                                    <div class="form-group">-->
<!--                                        <button type="submit" class="btn btn-primary">查询</button>-->
<!--                                        <a href="{:url('stat/charge')}" class="btn btn-info" style="color: white;position: absolute;left: 110px;">重置</a>-->
<!--                                    </div>-->
<!--                                </div>-->

<!--                            </form>-->



                                <div class="table-responsive">
                                    <table id="add-row" class="display table table-striped table-hover" >
                                        <thead>
                                        <tr>
                                            <th>类型</th>
                                            <th>加减</th>
                                            <th>变动金额</th>
                                            <th>余额</th>
                                            <th>创建时间</th>
                                            <th>备注</th>
                                        </tr>
                                        </thead>

                                        <tbody>

                                        {volist name="infos" id="vo"}
                                        <tr>
                                            <td>{$vo.type_desc}</td>
                                            <td>{$vo.change}</td>
                                            <td>{$vo.money}</td>
                                            <td>{$vo.balance}</td>
                                            <td>{$vo.create_time}</td>
                                            <td>{$vo.remark}</td>
                                        </tr>
                                        {/volist}

                                        </tbody>
                                    </table>

                                    <!-- 分页 (调取通用方法)-->
                                     <div class="layui-box layui-laypage layui-laypage-molv">{:pagination($infos)}</div>

                                </div>
                            </div>
                        </div>
                    </div>
                </div>


            </div>
        </div>

        {include file="public/_footer" /}


    </div>



</div>

{include file="public/_js" /}

</body>

<!--请在下方写此页面业务相关的脚本-->
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
    var SCOPE = {
        'add_url':"{:url('stat/editsave')}",
    };



    $(function(){
        var commitStatus = false;
        /*表单验证*/
        $("#form-modal").validate({
            rules:{
                money:{
                    required:true,
                    number:true
                }

            },
            onkeyup:false,
            focusCleanup:true,
            success:"valid",
            submitHandler:function(form){
                var url = SCOPE.add_url;
                if(commitStatus==true){
                    return false;
                }
                var money = $("#money").val();
                // if(!(/(^[1-9]\d*$)/.test(money))){
                //     layer.msg('充值金额只能输入正整数',{icon:2,time:2000});
                //     return
                // }
                /*表单提交*/
                $(form).ajaxSubmit({
                    type: 'post',
                    url: url,
                    success: function(data){
                        if(data.code == 1001){
                            commitStatus = true;
                            layer.msg(data.msg, {
                                icon: 1,
                                time: 2000
                            }, function(){
                                parent.location.reload();
                            });
                        }else{
                            layer.msg(data.msg,{icon:2,time:2000});
                        }
                    },
                    error: function(XmlHttpRequest, textStatus, errorThrown){
                        layer.msg(errorThrown,{icon:2,time:2000});
                    }
                });

            }
        });

    });

    function add_item(id,money,fzmoney,fwmoney,time,remark) {
        document.getElementById('form-modal').reset();
        $("#log_id").val(id);
        $("#money").val(money);
        $("#fz_money").val(fzmoney);
        $("#fw_money").val(fwmoney);
        $("#time").val(time);
        $("#remark").val(remark);
    }

    laydate.render({
        elem: '#times'
        ,type: 'datetime'
        ,range: true
    });


</script>

</html>




























